<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<link rel="stylesheet" href="style.css" type="text/css">
<meta content="text/html; charset=iso-8859-1" http-equiv="Content-Type">
<link rel="Start" href="index.html">
<link rel="previous" href="Generated.AST.html">
<link rel="Up" href="Generated.html">
<link title="Index of types" rel=Appendix href="index_types.html">
<link title="Index of exceptions" rel=Appendix href="index_exceptions.html">
<link title="Index of values" rel=Appendix href="index_values.html">
<link title="Index of modules" rel=Appendix href="index_modules.html">
<link title="Index of module types" rel=Appendix href="index_module_types.html">
<link title="Castling" rel="Chapter" href="Castling.html">
<link title="Generated" rel="Chapter" href="Generated.html"><title>Generated.Parser</title>
</head>
<body>
<div class="navbar"><a href="Generated.AST.html">Previous</a>
&nbsp;<a href="Generated.html">Up</a>
&nbsp;</div>
<center><h1>Module <a href="type_Generated.Parser.html">Generated.Parser</a></h1></center>
<br>
<pre><span class="keyword">module</span> Parser: <code class="code">sig</code> <a href="Generated.Parser.html">..</a> <code class="code">end</code></pre>This module has parsing functions.
This name <code class="code">Parser</code> depends on <code class="code">?parser_module</code> of calling <a href="Castling.ParserGenerator.html#VALgenerate"><code class="code">Castling.ParserGenerator.generate</code></a>.
Contents of this module be expanded if <code class="code">?parser_module</code> was not given.<br>
<hr width="100%">
<pre><span class="keyword">val</span> <a name="VALdebug"></a>debug : <code class="type">bool Pervasives.ref</code></pre><div class="info">
When <code class="code">true</code>, printing current state to stderr and checking infinity loop.
	The initial setting for <code class="code">debug</code> is <code class="code">false</code>.
	This value be generated only if <a href="Castling.ParserGenerator.html#VALruntime_debug"><code class="code">Castling.ParserGenerator.runtime_debug</code></a> was <code class="code">true</code>.<br>
</div>
<br><code><span class="keyword">type</span> <a name="TYPEvalue"></a><code class="type">'a</code> value = </code><table class="typetable">
<tr>
<td align="left" valign="top" >
<code><span class="keyword">|</span></code></td>
<td align="left" valign="top" >
<code><span class="constructor">Value_B_position_elt_E</span> <span class="keyword">of</span> <code class="type">(('a * 'a) * Token.t option)</code></code></td>

</tr>
<tr>
<td align="left" valign="top" >
<code><span class="keyword">|</span></code></td>
<td align="left" valign="top" >
<code><span class="constructor">Value_elt</span> <span class="keyword">of</span> <code class="type">Token.t option</code></code></td>

</tr>
<tr>
<td align="left" valign="top" >
<code><span class="keyword">|</span></code></td>
<td align="left" valign="top" >
<code><span class="constructor">Value_variant</span> <span class="keyword">of</span> <code class="type">'a <a href="Generated.AST.html#TYPEvariant">Generated.AST.variant</a> option</code></code></td>

</tr></table>

<div class="info">
Variant holding parts of abstract syntax tree types.
	This type is internally used only in this module.<br>
</div>

<pre><span class="keyword">val</span> <a name="VALtoken_1"></a>token_1 : <code class="type">char</code></pre><div class="info">
Token constant of <code class="code">"1"</code> for internal use to make error value.<br>
</div>
<pre><span class="keyword">val</span> <a name="VALtoken_x"></a>token_x : <code class="type">char</code></pre><div class="info">
Token constant of <code class="code">"x"</code> for internal use to make error value.<br>
</div>
<br><code><span class="keyword">type</span> <a name="TYPEerror"></a><code class="type"></code>error = </code><table class="typetable">
<tr>
<td align="left" valign="top" >
<code><span class="keyword">|</span></code></td>
<td align="left" valign="top" >
<code><span class="constructor">Unexpected</span> <span class="keyword">of</span> <code class="type">Token.t</code></code></td>
<td class="typefieldcomment" align="left" valign="top" ><code>(*</code></td><td class="typefieldcomment" align="left" valign="top" >token unexpected but found</td><td class="typefieldcomment" align="left" valign="bottom" ><code>*)</code></td>
</tr>
<tr>
<td align="left" valign="top" >
<code><span class="keyword">|</span></code></td>
<td align="left" valign="top" >
<code><span class="constructor">Unexpected_z</span></code></td>
<td class="typefieldcomment" align="left" valign="top" ><code>(*</code></td><td class="typefieldcomment" align="left" valign="top" >error case marked with <a href="Castling.ParserGenerator.html#VALerror"><code class="code">Castling.ParserGenerator.error</code></a> found</td><td class="typefieldcomment" align="left" valign="bottom" ><code>*)</code></td>
</tr>
<tr>
<td align="left" valign="top" >
<code><span class="keyword">|</span></code></td>
<td align="left" valign="top" >
<code><span class="constructor">Expected</span> <span class="keyword">of</span> <code class="type">Token.t list</code></code></td>
<td class="typefieldcomment" align="left" valign="top" ><code>(*</code></td><td class="typefieldcomment" align="left" valign="top" >one of tokens expected but not found</td><td class="typefieldcomment" align="left" valign="bottom" ><code>*)</code></td>
</tr>
<tr>
<td align="left" valign="top" >
<code><span class="keyword">|</span></code></td>
<td align="left" valign="top" >
<code><span class="constructor">Expected_variant</span></code></td>
<td class="typefieldcomment" align="left" valign="top" ><code>(*</code></td><td class="typefieldcomment" align="left" valign="top" >non-terminal symbol expected but skipped</td><td class="typefieldcomment" align="left" valign="bottom" ><code>*)</code></td>
</tr></table>

<div class="info">
This type represents an error parser detected.
	Non-terminal symbols prefixed <code class="code">Expected_optional_</code> could be epsilon and has not to report necessity.
	The type of value that <code class="code">Unexpected</code> and <code class="code">Expected</code> holds is depend on <code class="code">Token</code> parameter of <a href="Castling.ParserGenerator.html"><code class="code">Castling.ParserGenerator</code></a>.<br>
</div>

<pre><span class="keyword">val</span> <a name="VALpp_list"></a>pp_list : <code class="type">(Format.formatter -> 'a -> unit) -> Format.formatter -> 'a list -> unit</code></pre><div class="info">
Pretty printer for <code class="code">'a list</code>.
	This function be generated only if <a href="Castling.ParserGenerator.html#VALerror_printer"><code class="code">Castling.ParserGenerator.error_printer</code></a> was <code class="code">true</code>.<br>
</div>
<pre><span class="keyword">val</span> <a name="VALpp_error"></a>pp_error : <code class="type">(Format.formatter -> Token.t -> unit) -><br>       Format.formatter -> <a href="Generated.Parser.html#TYPEerror">error</a> -> unit</code></pre><div class="info">
Pretty printer for <a href="Generated.Parser.html#TYPEerror"><code class="code">Generated.Parser.error</code></a>.
	This function be generated only if <a href="Castling.ParserGenerator.html#VALerror_printer"><code class="code">Castling.ParserGenerator.error_printer</code></a> was <code class="code">true</code>.<br>
</div>
<br><code><span class="keyword">type</span> <a name="TYPEstack_item"></a><code class="type">'a</code> stack_item = {</code><table class="typetable">
<tr>
<td align="left" valign="top" >
<code>&nbsp;&nbsp;</code></td>
<td align="left" valign="top" >
<code>position&nbsp;: <code class="type">'a * 'a</code>;</code></td>

</tr>
<tr>
<td align="left" valign="top" >
<code>&nbsp;&nbsp;</code></td>
<td align="left" valign="top" >
<code>value&nbsp;: <code class="type">'a <a href="Generated.Parser.html#TYPEvalue">value</a></code>;</code></td>

</tr>
<tr>
<td align="left" valign="top" >
<code>&nbsp;&nbsp;</code></td>
<td align="left" valign="top" >
<code>goto_f&nbsp;: <code class="type">int -> 'a * 'a -> Token.t -> 'a <a href="Generated.Parser.html#TYPEt">t</a> -> 'a <a href="Generated.Parser.html#TYPEt">t</a></code>;</code></td>

</tr></table>
}

<div class="info">
Parsing state.
	This type is internally used only in this module.
	Positions be pair only if <a href="Castling.ParserGenerator.html#VALranged_position"><code class="code">Castling.ParserGenerator.ranged_position</code></a> was <code class="code">true</code>.<br>
</div>

<br><code><span class="keyword">type</span> <a name="TYPEt"></a><code class="type">'a</code> t = {</code><table class="typetable">
<tr>
<td align="left" valign="top" >
<code>&nbsp;&nbsp;</code></td>
<td align="left" valign="top" >
<code>state_f&nbsp;: <code class="type">'a * 'a -> Token.t -> 'a <a href="Generated.Parser.html#TYPEt">t</a> -> 'a <a href="Generated.Parser.html#TYPEt">t</a></code>;</code></td>

</tr>
<tr>
<td align="left" valign="top" >
<code>&nbsp;&nbsp;</code></td>
<td align="left" valign="top" >
<code>stack&nbsp;: <code class="type">'a <a href="Generated.Parser.html#TYPEstack_item">stack_item</a> list</code>;</code></td>

</tr>
<tr>
<td align="left" valign="top" >
<code>&nbsp;&nbsp;</code></td>
<td align="left" valign="top" >
<code>errors&nbsp;: <code class="type">(('a * 'a) * <a href="Generated.Parser.html#TYPEerror">error</a>) list</code>;</code></td>

</tr>
<tr>
<td align="left" valign="top" >
<code>&nbsp;&nbsp;</code></td>
<td align="left" valign="top" >
<code>accepted&nbsp;: <code class="type">bool</code>;</code></td>

</tr>
<tr>
<td align="left" valign="top" >
<code>&nbsp;&nbsp;</code></td>
<td align="left" valign="top" >
<code><span class="keyword">mutable&nbsp;</span>path&nbsp;: <code class="type">(int * int) list</code>;</code></td>

</tr></table>
}

<div class="info">
Parser type.
	Please take this type like abstract data type.
	Positions be pair only if <a href="Castling.ParserGenerator.html#VALranged_position"><code class="code">Castling.ParserGenerator.ranged_position</code></a> was <code class="code">true</code>.
	<code class="code">.path</code> field be generated only if <a href="Castling.ParserGenerator.html#VALruntime_debug"><code class="code">Castling.ParserGenerator.runtime_debug</code></a> was <code class="code">true</code>.<br>
</div>

<pre><span class="keyword">val</span> <a name="VALstate_debug"></a>state_debug : <code class="type">'a <a href="Generated.Parser.html#TYPEt">t</a> -> int -> unit</code></pre><div class="info">
Printing state number to stderr and checking infinity loop.
	This function is internally used only in this module.
	This function be generated only if <a href="Castling.ParserGenerator.html#VALruntime_debug"><code class="code">Castling.ParserGenerator.runtime_debug</code></a> was <code class="code">true</code>.<br>
</div>
<pre><span class="keyword">val</span> <a name="VALstate_0"></a>state_0 : <code class="type">'a * 'a -> Token.t -> 'a <a href="Generated.Parser.html#TYPEt">t</a> -> 'a <a href="Generated.Parser.html#TYPEt">t</a></code></pre><div class="info">
Given token dispatcher of state 0.
	This function is internally used only in this module.
	Third parameter be pair only if <a href="Castling.ParserGenerator.html#VALranged_position"><code class="code">Castling.ParserGenerator.ranged_position</code></a> was <code class="code">true</code>.<br>
</div>
<pre><span class="keyword">val</span> <a name="VALgoto_0"></a>goto_0 : <code class="type">int -> 'a * 'a -> Token.t -> 'a <a href="Generated.Parser.html#TYPEt">t</a> -> 'a <a href="Generated.Parser.html#TYPEt">t</a></code></pre><div class="info">
Reduced symbol dispatcher of state 0.
	This function is internally used only in this module.
	Third parameter be pair only if <a href="Castling.ParserGenerator.html#VALranged_position"><code class="code">Castling.ParserGenerator.ranged_position</code></a> was <code class="code">true</code>.<br>
</div>
<pre><span class="keyword">val</span> <a name="VALstate_1"></a>state_1 : <code class="type">'a * 'a -> Token.t -> 'a <a href="Generated.Parser.html#TYPEt">t</a> -> 'a <a href="Generated.Parser.html#TYPEt">t</a></code></pre><div class="info">
Given token dispatcher of state 1.<br>
</div>
<pre><span class="keyword">val</span> <a name="VALstate_2"></a>state_2 : <code class="type">'a * 'a -> Token.t -> 'a <a href="Generated.Parser.html#TYPEt">t</a> -> 'a <a href="Generated.Parser.html#TYPEt">t</a></code></pre><div class="info">
Given token dispatcher of state 2.<br>
</div>
<pre><span class="keyword">val</span> <a name="VALstate_3"></a>state_3 : <code class="type">'a * 'a -> Token.t -> 'a <a href="Generated.Parser.html#TYPEt">t</a> -> 'a <a href="Generated.Parser.html#TYPEt">t</a></code></pre><div class="info">
Given token dispatcher of state 3.<br>
</div>
<pre><span class="keyword">val</span> <a name="VALstate_4"></a>state_4 : <code class="type">'a * 'a -> Token.t -> 'a <a href="Generated.Parser.html#TYPEt">t</a> -> 'a <a href="Generated.Parser.html#TYPEt">t</a></code></pre><div class="info">
Given token dispatcher of state 4.<br>
</div>
<pre><span class="keyword">val</span> <a name="VALgoto_error"></a>goto_error : <code class="type">int -> 'a * 'a -> Token.t -> 'a <a href="Generated.Parser.html#TYPEt">t</a> -> 'a <a href="Generated.Parser.html#TYPEt">t</a></code></pre><div class="info">
Given token dispatcher of state has not to reduce, does <code class="code">assert false</code>.
	This function is internally used only in this module.<br>
</div>
<pre><span class="keyword">val</span> <a name="VALcreate"></a>create : <code class="type">unit -> 'a <a href="Generated.Parser.html#TYPEt">t</a></code></pre><div class="info">
New parser.<br>
</div>
<pre><span class="keyword">val</span> <a name="VALpost"></a>post : <code class="type">'a * 'a -> Token.t -> 'a <a href="Generated.Parser.html#TYPEt">t</a> -> 'a <a href="Generated.Parser.html#TYPEt">t</a></code></pre><div class="info">
To give the parser next token with position.
	Third parameter be pair only if <a href="Castling.ParserGenerator.html#VALranged_position"><code class="code">Castling.ParserGenerator.ranged_position</code></a> was <code class="code">true</code>.
	Otherwise, This function be <code class="code">val post : 'a t -&gt; 'a -&gt; Token.t -&gt; unit</code>.<br>
</div>
<pre><span class="keyword">val</span> <a name="VALaccepted"></a>accepted : <code class="type">'a <a href="Generated.Parser.html#TYPEt">t</a> -> bool</code></pre><div class="info">
To check which is parsing finished.<br>
</div>
<pre><span class="keyword">val</span> <a name="VALresult"></a>result : <code class="type">'a <a href="Generated.Parser.html#TYPEt">t</a> -> 'a <a href="Generated.AST.html#TYPEvariant">Generated.AST.variant</a> option</code></pre><div class="info">
To get abstract syntax tree that is result of parsing.
	When <code class="code">accepted</code> returns <code class="code">false</code>, this function will fail <code class="code">assert</code>.<br>
</div>
<pre><span class="keyword">val</span> <a name="VALerrors"></a>errors : <code class="type">'a <a href="Generated.Parser.html#TYPEt">t</a> -> (('a * 'a) * <a href="Generated.Parser.html#TYPEerror">error</a>) list</code></pre><div class="info">
Detected errors.
	Positions be pair only if <a href="Castling.ParserGenerator.html#VALranged_position"><code class="code">Castling.ParserGenerator.ranged_position</code></a> was <code class="code">true</code>.
	Otherwise, This function be <code class="code">val errors : 'a t -&gt; ('a * error) list</code>.<br>
</div>
</body></html>